import request from '@/utils/request'
import { commonBaseUrl } from '@/utils'

const moduleName = commonBaseUrl('C') || 'acceptance/'

export function NewgetPrjDetailApi(prjId) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/getAcceptPrjInfo?prjId=' + prjId,
    method: 'get'
  })
}
// 获取项目基本信息
export function getPrjDetailApi(data) {
  return request({
    url: moduleName + 'api/accept/itAcceptance/getInfoInItInfo?prjId=' + data,
    method: 'get'
  })
}
// 获取项目流程信息
export function getWFWorkItemApi(data) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/getWFWorkItem?workItemId=' + data,
    method: 'get'
  })
}
// 物资服务同步财务/资源
export function checkPushResourceAndFinance(data) {
  return request({
      url: moduleName + 'api/accept/acceptanceVerification/checkPushResourceAndFinance?prjId=' + data,
      method: 'post',
    showLoading: true
  })
}
// 物资服务同步财务/资源
export function pushAllResourceAndFinance(data) {
  return request({
      // url: moduleName + 'api/accept/pushAllResourceAndFinance?prjId=' + data,
      url: moduleName + 'api/accept/pushAllMaterialResource?prjId=' + data,
      method: 'post',
    showLoading: true
  })
}

// 资源录入
export function checkResourceEnter(data) {
  return request({
      url: moduleName + 'api/accept/acceptanceVerification/checkResourceEnter?prjId=' + data,
      method: 'get',
    showLoading: true
  })
}

// 资源确认
export function getResourceConfirm(data) {
  return request({
      url: moduleName + 'api/accept/acceptanceVerification/getResourceConfirm?prjId=' + data,
      method: 'get'
  })
}

// 获取验收阶段全部时间
export function getAccTimeInfo(params) {
  return request({
      url: moduleName + 'api/accept/itAcceptance/getItAcceptAllTime',
      method: 'get',
      params
  })
}

// 获取项目验收流程发起时间 //最后一个节点审批完成时间
export function getAcceptProcessInitiationTime(params) {
  return request({
      url: moduleName + 'api/accept/itAcceptance/getAcceptProcessInitiationTime',
      method: 'get',
      params
  })
}

// 获取项目验收流程发起时间 //最后一个节点审批完成时间
export function getStartAcceptTime(params) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/getStartAcceptTime',
    method: 'get',
    params
  })
}

// 保存IT信息化项目验收时间
export function updateItAcceptTime(params) {
  return request({
      url: moduleName + 'api/accept/itAcceptance/updateItAcceptTime',
      method: 'post',
      data: params,
    showLoading: true
  })
}

// 获取VR 跳转地址
export function getPanoramaUrl(data) {
  return request({
      url: moduleName + 'api/accept/acceptanceVerification/getPanoramaUrl?prjId=' + data,
      method: 'get',
    showLoading: true
  })
}
// 下一步前的校验(在途,附件)
export function checkCommonVerificationApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/checkCommonVerification',
    method: 'POST',
    data,
    showLoading: true
  })
}

// 下一步前的校验(公共)
export function itAcceptDoNextVerificationApi(data) {
  return request({
    url: moduleName + 'api/accept/itAcceptance/itAcceptDoNextVerification',
    method: 'POST',
    data,
    showLoading: true
  })
}
// 下一步前的校验(签证金额是否一直)
export function projectVisaVerificationApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/projectVisaVerification?prjId=' + data,
    method: 'get',
    showLoading: true
  })
}
// 下一步前的校验(第三个二次确认)
export function getNotPushedDetailCodeApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/getNotPushedDetailCode?prjId=' + data,
    method: 'get'
  })
}
// 下一步前的校验(推送)
export function inspectionValuationPushApi(data) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/inspectionValuationPush?prjId=' + data,
    method: 'get'
  })
}
// 下一步前的校验(工程建设的终验)
export function checkMaterialServiceAmountApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/checkMaterialServiceAmount?prjId=' + data,
    method: 'get'
  })
}
// 确认下一步
export function doNextFLowApi(data) {
  return request({
    url: moduleName + 'api/accept/doNextFLow',
    data,
    method: 'POST',
    showLoading: true
  })
}
// 回退
export function backActivityApi(data) {
  return request({
    url: moduleName + 'api/accept/backActivity',
    data,
    method: 'POST',
    showLoading: true
  })
}

// 是否显示服务明细
export function configButtonIsDisplayedApi(params) {
  return request({
    url: commonBaseUrl('D') + 'api/service/serviceDetailConfig/configButtonIsDisplayed',
    params,
    method: 'POST'
  })
}
// 服务明细展示校验(是否需要配置)
export function checkConfigDetailVerifyApi(params) {
  return request({
    url: commonBaseUrl('D') + 'api/service/serviceDetailConfig/checkConfigDetailVerify',
    params,
    method: 'GET',
    showLoading: true
  })
}
// 服务明细展示校验
export function checkServiceDetailsConfigurationApi(params) {
  return request({
    url: commonBaseUrl('D') + 'api/service/serviceDetailConfig/checkServiceDetailsConfiguration',
    params,
    method: 'GET',
    showLoading: true
  })
}

// 会签节点下一步流程
export function hqBtnNext(data) {
  return request({
    url: moduleName + 'api/accept/nextCountersignInfoIt',
    data,
    method: 'Post',
    showLoading: true
  })
}
